//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __CVARIABLEOFWSTRINGBUF_H__
#define __CVARIABLEOFWSTRINGBUF_H__

#include <elastos.h>
_ELASTOS_NAMESPACE_USING

class CVariableOfWStringBuf  : public IVariableOfWStringBuf,
                                  public IWStringBufSetter,
                                  public IWStringBufGetter
{
public:
    CARAPI_(PInterface) Probe(REIID riid);
    CARAPI_(UInt32) AddRef();
    CARAPI_(UInt32) Release();
    CARAPI Aggregate(AggregateType type, PInterface pObj);
    CARAPI GetDomain(PInterface *ppObj);

    CARAPI GetTypeInfo(
        /* [out] */ IDataTypeInfo ** ppTypeInfo);

    CARAPI GetPayload(
        /* [out] */ PVoid * pPayload);

    CARAPI Rebox(
        /* [in] */ PVoid localVariablePtr);

    CARAPI GetSetter(
        /* [out] */ IWStringBufSetter ** ppSetter);

    CARAPI GetGetter(
        /* [out] */ IWStringBufGetter ** ppGetter);

    CARAPI SetElement(
        /* [in] */ Int32 index,
        /* [in] */ WChar character);

    CARAPI SetData(
        /* [in] */ WString str);

    CARAPI GetCapacity(
        /* [out] */ Int32 * pCapacity);

    CARAPI GetLength(
        /* [out] */ Int32 * pLength);

    CARAPI GetElement(
        /* [in] */ Int32 index,
        /* [out] */ WChar * pCharacter);

    CARAPI GetData(
        /* [out] */ WStringBuf * pStringBuf);

    CVariableOfWStringBuf(
        /* [in] */ PWStringBuf pWsb,
        /* [in] */ Boolean bAlloc);

    virtual ~CVariableOfWStringBuf();

private:
    PWStringBuf     m_pWsb;
    Boolean         m_bAlloc;

    Interlocked m_cRef;
};

#endif // __CVARIABLEOFWSTRINGBUF_H__
